home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume10 / cbw / part11 < prev    next >
Encoding:
Internet Message Format  |  1987-06-20  |  53.5 KB

  1. Path: seismo!uunet!rs
  2. From: rs@uunet.UU.NET (Rich Salz)
  3. Newsgroups: comp.sources.unix
  4. Subject: v10i011:  Crypt Breaker's Workbench, Part11/11
  5. Message-ID: <413@uunet.UU.NET>
  6. Date: 21 Jun 87 16:37:13 GMT
  7. Organization: UUNET Communications Services, Arlington, VA
  8. Lines: 1089
  9. Approved: rs@uunet.uu.net
  10.  
  11. Submitted by: Robert W. Baldwin <BALDWIN@XX.LCS.MIT.EDU>
  12. Mod.sources: Volume 10, Issue 11
  13. Archive-name: cbw/Part11
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then unpack
  17. # it by saving it into a file and typing "sh file".  To overwrite existing
  18. # files, type "sh file -c".  You can also feed this as standard input via
  19. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  20. # will see the following message at the end:
  21. #        "End of archive 11 (of 11)."
  22. # Contents:  cbw.doc
  23. # Wrapped by rs@uunet on Wed Jun 17 18:17:34 1987
  24. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  25. if test -f cbw.doc -a "${1}" != "-c" ; then 
  26.   echo shar: Will not over-write existing file \"cbw.doc\"
  27. else
  28. echo shar: Extracting \"cbw.doc\" \(51998 characters\)
  29. sed "s/^X//" >cbw.doc <<'END_OF_cbw.doc'
  30. X
  31. X
  32. X
  33. X
  34. X
  35. X
  36. X
  37. X                           CRYPT BREAKERS WORKBENCH
  38. X
  39. X                                 USERS MANUAL
  40. X
  41. X
  42. X
  43. X
  44. X
  45. X
  46. X
  47. X
  48. X                               Robert W. Baldwin
  49. X                            baldwin@xx.lcs.mit.edu
  50. X                               mit-eddie!baldwin
  51. X                                 October, 1986
  52. X
  53. XOverview
  54. X     The  Crypt Breakers' Workbench (CBW) is an interactive multi-window system
  55. Xfor mounting a cipher-text only attack on a file encrypted by  the  Unix  crypt
  56. Xcommand.    CBW  is  a workbench in the sense that it provides the user with an
  57. Xintegrated set of tools that simplify the initial, middle and final portions of
  58. Xthe  decryption process.  A user interacts with the workbench by choosing tools
  59. Xand setting parameters.  CBW carries out the work and displays the results.   A
  60. Xmoderately  experienced  user  of  CBW  can  easily decrypt both long and short
  61. Xmessages when bigram statistics are known for the message  space.    The  basic
  62. Xcryptanalytic  techniques  used  by  CBW  are described in a paper by Reeds and
  63. XWeinberger that appeared in the October 1984 issue of the ATT Bell Laboratories
  64. XTechnical  Journal.    This  manual  explains  the  capabilities  and operating
  65. Xprocedures of CBW.
  66. X
  67. X1. Introduction to the Workbench
  68. X     A workbench is a place where a craftsman can quickly and comfortably carry
  69. Xout  a  wide range of tasks.  The ease of performing tasks comes from the range
  70. Xof tools present on the workbench and the experience of the  craftsman.    Each
  71. Xtool  has  its strengths and limitations, but the craftsman can select the best
  72. Xtool for the job at hand.  The workbench is not a  static  thing.    Often  the
  73. Xcraftsman builds a jig that is tailored to a particular problem.  Some jigs are
  74. Xlater discarded while others become permanent fixtures of the workbench.  It is
  75. Xin  this  sense  of the term workbench that CBW is a workbench for breaking the
  76. XUnix crypt cipher.
  77. X
  78. X     CBW has evolved over the past two years, and it will continue to evolve as
  79. Xthe  process of decrypting Unix files becomes better understood.  Already I can
  80. Xthink of commands that I want to add to speed up the end-game of the decryption
  81. Xprocess.  It is being released in its current form to allow others to play with
  82. Xit and add their own ideas.
  83. X
  84. X     One goal of releasing CBW is to discourage  people  from  using  the  Unix
  85. Xcrypt  command  for  sensitive  information.   Crypt was never intended to be a
  86. Xhighly secure cipher.  It's primary advantage has been its speed, which made it
  87. Xsuitable  for  integration  into a wide range of application programs.  The CBW
  88. Xprogram simply points out how easy the cipher  is  to  break  using  the  ideas
  89. Xdescribed  by  Reeds  and  Weinberger in the October 1984 issue of the ATT Bell
  90. XLabs Technical Journal.  As those authors suggested, if you must use crypt, you
  91. Xshould run compress on the file before encrypting it.
  92. X
  93. X2. Key Space Attack
  94. X     The basic metaphor of CBW is that the computer knows several message-space
  95. Xsearching strategies, and the user decides which strategy to  try  next.    The
  96. Xprogram  takes  on the burden of carrying out the strategy, but it is up to the
  97. Xuser to choose the strategy and to set  the  necessary  parameters  (e.g.,  how
  98. Xclose  a  scoring  statistic has to be to its expected value before the program
  99. Xwill accept a guess).  When a strategy completes, its  results  are  displayed.
  100. XAn  important  feature  of  the  program is that the results are displayed in a
  101. Xmanner that makes it easy for the user to decide what to do next.  Further,  it
  102. Xeasy  to  carry out decisions such as accepting the outcome as is, accepting it
  103. Xwith minor changes, or starting over with a different strategy or  a  different
  104. Xparameter setting.
  105. X
  106. X     To use CBW it is necessary to know a few facts about the underlying cipher
  107. Xsystem, in this case the Unix crypt program.  The primary fact to know is  that
  108. Xthe  job  of  deciphering  a file can be broken down into several smaller jobs.
  109. XThe ciphertext being decoded can be divided into blocks of 256 characters,  and
  110. Xeach block can be decoded separately.
  111. X
  112. X     Each  block  is encrypted using a relatively simple cipher system, but the
  113. Xkey to this simple system changes at the end of each block.  Effectively,  each
  114. Xblock  is  encrypted  by  a  single  rotor  enigma  system.   The rotor has 256
  115. Xpositions to handle full eight-bit bytes, and  this  leads  to  the  number  of
  116. Xcharacters  in each block.  CBW represents the wiring for each block's rotor by
  117. Xa permutation matrix.
  118. X
  119. X     Once several blocks are decoded (or mostly decoded), it  becomes  possible
  120. Xto determine how the key changes after each block.  The key change is expressed
  121. Xas a permutation matrix called Zee.  Typically one needs to solve four or  five
  122. Xblocks  (about 1000 characters), before it is possible to automatically compute
  123. XZee and solve the rest of the file.  For short messages there  is  no  need  to
  124. Xcompute Zee.
  125. X
  126. X     After  the  inter-block  relationship  has  been  determined, the program,
  127. Xzeecode, can be used to decipher the whole file.  The program zeecode looks  at
  128. Xthe  save-file  produced  by  CBW  to get the information it needs to decode an
  129. Xentire file.
  130. X
  131. X3. Files, Terminals and Shell Variables
  132. X     This documentation assumes that the code, source, and datafiles  are  kept
  133. Xin  a  directory  called  /projects/Ecrypt,  but  these  files  could be placed
  134. Xanywhere.
  135. X
  136. X     The most important files are  the  program  itself,  and  the  files  that
  137. Xcontain  the  English  language  statistics.  The program is called 'cbw'.  The
  138. Xstatistics files are 'mss.stats', 'mss-bigram.stats', and 'trigram.stats'.  For
  139. Xthe probable word guessing command there are files like 'common.words'.
  140. X
  141. X     To  make it easy for users to provide their own statistics files, cbw uses
  142. Xthe shell variables LETTERSTATS, BIGRAMSTATS, and TRIGRAMSTATS to access  these
  143. Xfiles.      The  variable  DICTIONARY  identifies  a  file  of  words  for  the
  144. Xlookup-pattern command (one word per line).  These shell variables must be  set
  145. Xto  the full pathnames for the desired files.  The file stats.slice defines all
  146. Xof these variables.  Your .login file should contain a line like:  
  147. X
  148. X                     source  /projects/Ecrypt/stats.slice
  149. X
  150. X     The main input to cbw is a ciphertext file, and the main output is a  save
  151. Xfile  that  specifies how the ciphertext can be decoded.  The program 'zeecode'
  152. Xuses CBW's save file to decode the ciphertext file.  The  ciphertext  file  for
  153. Xcbw  is  assumed  to  have a name like 'fileroot.cipher'.  The output of cbw is
  154. Xstored in the file named 'fileroot.perm'.  The '.perm' stands for permutation.
  155. X
  156. X
  157. X
  158. X3.1. Terminal compatibility
  159. X     CBW is designed to run on any display terminal.  To run  on  a  particular
  160. Xterminal  CBW  must be able to generate graphic characters on that terminal and
  161. Xbe able to recognize the escape sequences sent by that terminal's function keys
  162. X(e.g.,  the  arrow keys).  CBW adapts to different terminals by examining shell
  163. Xvariables (TERM, GRAPHICSMAP, and KEYMAP), the termcap entry, and  compiled  in
  164. Xdefaults.   It builds a keystroke map and a graphics symbol map which translate
  165. Xbetween arbitrarily  long  sequences  of  ascii  characters  and  the  internal
  166. Xrepresentation  for  keystroke  commands and graphic symbols.  The rest of this
  167. Xdocument will describe the action of keys, but the reader should remember  that
  168. Xthe binding between commands and keys can be changed.
  169. X
  170. X     You  should  be  able  to  use  CBW  without  understanding the details of
  171. Xterminal handling, but for completeness, those details  are  presented  in  the
  172. Xappendix.  You will need to be sure that the shell variable TERM identifies the
  173. Xkind of terminal you are using.  You should also be able to find a shell script
  174. Xthat  will  set up the graphics map for your terminal.  List the files matching
  175. X/projects/Ecrypt/*.slice,  if  there  is   one   for   your   terminal   (e.g.,
  176. Xvt100.slice),  execute  it  to  initialize the necessary shell variables (e.g.,
  177. Xsource /projects/Ecrypt/vt100.slice).
  178. X
  179. X     In general an unrecognized  keystroke  generates  a  self-insert  command.
  180. XHowever, control characters other than newline and tab are reserved for default
  181. Xkeystroke commands.  To insert a control character, precede it by a C-Q.    The
  182. XC-Q  command  will  create  a  self-insert command for the next ascii character
  183. Xreceived from the terminal.
  184. X
  185. X     The notation C-N will be used to represent pressing the N or n  key  while
  186. Xthe control key is held down.
  187. X
  188. X4. Getting Started and Getting Out
  189. X     After  setting  up  the shell variables described in the previous section,
  190. Xyou can invoke the Crypt Breakers' Workbench from any directory by typing:  
  191. X
  192. X                        /projects/Ecrypt/cbw  fileroot
  193. X
  194. XWhere 'fileroot.cipher' is the name of  the  ciphertext  file  in  the  current
  195. Xdirectory.   You do not need to specify the full pathname of the cbw program if
  196. X/project/Ecrypt is in your shell's search path.
  197. X
  198. X     To exit the program move the cursor to the bottom window (using the  arrow
  199. Xkeys  or  C-N or C-X), then type 'q', a space, and a return.  The 'q' signifies
  200. Xthe quit command, the space causes command  completion  to  be  invoked  (i.e.,
  201. X'qui    ' would work just as well), and the return key causes the command to be
  202. Xexecuted.  If you have changed the decryption window since you last saved  your
  203. Xwork, the program will ask if you really want to quit.  Type 'y' if you want to
  204. Xquit, or any other key to abort the quit command.
  205. X
  206. X5. Commands
  207. X     There are two types of commands: keystroke and user commands.    Keystroke
  208. Xcommands are interpreted by the window that currently contains the cursor.  For
  209. Xexample, the up-arrow key generally moves the cursor up by one line, but in the
  210. Xdecryption-block window, it moves the cursor up two lines.  An attempt has been
  211. Xmade to keep the keystroke commands uniform  and  emacs-like.    The  keystroke
  212. Xcommands will be explained for each window.
  213. X
  214. X     The  user commands can take arguments typed by the user.  They are entered
  215. Xinto the command line via a simple editor and executed when the  user  types  a
  216. Xreturn.    The  cursor  must  be in the user i/o window to type or execute user
  217. Xcommands.  The details of the editor are given in the section on the  user  i/o
  218. Xwindow.  Each user command is explained in section 7.
  219. X
  220. X-------------------------------------------------------------------------------
  221. X
  222. X                    Crypt Breakers' Workbench
  223. XBlock - 0                                Know  14 of 128 wires   |Word Match
  224. X                                                                 |.n.y
  225. X@Device[dover]......e[...........o.............A.........@....i. |Andy
  226. X                                                                 |envy
  227. X......................... ...................................... |indy
  228. X                                                                 |only
  229. X....... .................................................xt.r.a. |
  230. X                                                                 |
  231. X..o.......s.........d.s.............e.........t....o.mu......on  |
  232. X                                                                 |
  233. X                                                                 |
  234. X                                                                 |
  235. XProbable word search -- Done                                     |
  236. X@Device[dover]..t...e[Font.timesroman..].....e.A..i.l....@Sectio |
  237. Xn..n..................... .r...n......n.ly.....on.....h......... |
  238. X....... .........;................ons.......e .c.... ....xt.r.a. |
  239. X..o.......s.........d.s.............e.........t.. .o.mu..c...on  |
  240. X                                                                 |
  241. X                                                                 `----------
  242. X
  243. XHelp   : F3 enters guess, ^G undoes it.
  244. XStatus : Command completed.
  245. XCommand: pwords-from file: mss.words  Max dev: 1.2 (try 1.0)
  246. X
  247. X-------------------------------------------------------------------------------
  248. X
  249. X                          Figure 5-1:   Sample Screen
  250. X
  251. X6. Windows
  252. X     The  screen  is  partitioned  into  seven  windows as shown in figure 5-1.
  253. XAssociated with each window is a  keystroke  command  interpreter  and  private
  254. Xstate  information.    By  convention  keys  like  up-arrow, C-D, and delete do
  255. Xsimilar things in all the windows.
  256. X
  257. X     There are some keystrokes that have the same effects in all windows,  they
  258. Xare:
  259. X
  260. XC-L             Redraw the whole screen.
  261. X
  262. XC-X, F4         Jump to command input line.
  263. X
  264. XC-Q             Quote.  Insert the following character.
  265. X
  266. XC-Z             Abort  the current command, restore the terminal modes, suspend
  267. X                the program and return  to  the  shell.    If  the  program  is
  268. X                restarted,  the  terminal  will  be initialized for CBW and the
  269. X                screen redrawn.  The command that was active (if any) when  the
  270. X                C-Z  was received is aborted.  Actually this command is invoked
  271. X                when CBW receives a SIGTSTP signal.
  272. X
  273. XC-C             Restore the terminal modes and kill the CBW process.   Actually
  274. X                this command is invoked when CBW receives a SIGINT signal.
  275. X
  276. X     The following subsections describe the features of the windows starting at
  277. Xthe top of the screen and working downwards.
  278. X
  279. X
  280. X
  281. X6.1. Banner window
  282. X     This window contains the program title.  Default behavior for arrow keys.
  283. X
  284. X
  285. X
  286. X6.2. Decryption Block Label window
  287. X     This window contains a single line that describes the block  displayed  in
  288. Xthe decryption block storage window.  The block number is shown at the left end
  289. Xof the line.  The right hand side of this line displays how much is known about
  290. Xthe  decryption  permutation for the current block.  This value is expressed in
  291. Xterms of the number of wires (2-cycles in the permutation) that are known.    A
  292. Xdecryption  permutation  that  maps character A to B also maps B to A, so there
  293. Xare only 128 wires even though there are 256 possible characters.
  294. X
  295. X
  296. X
  297. X6.3. Decryption Block Storage window
  298. X     Displays what is known about the plaintext corresponding to a single block
  299. Xof  256  ciphertext  characters.    A  dot character, which is different from a
  300. Xperiod character, is shown when the plaintext  character  is  unknown.    Other
  301. Xgraphic   characters  represent  control  characters  like  newline,  tab,  and
  302. Xform-feed.  If a character decrypts into a byte  that  has  the  high  bit  set
  303. X(i.e., not an ascii character), it shows as a solid diamond.
  304. X
  305. X     Most  keystrokes  are self-insert commands.  When a character is inserted,
  306. Xit replaces the character at the current position, and any  deduced  characters
  307. Xare  displayed  and  highlighted (by underlining).  The other keystroke command
  308. Xcharacters are:
  309. X
  310. XC-D, DEL        Delete character forward,  delete  backward.    This  forces  a
  311. X                permutation wiring to be removed.  It can do unexpected things.
  312. X                Consider a permutation with  A  wired  to  B  and  P  wired  to
  313. X                Q.  Adding  a  wire  from B to P, then removing it with the DEL
  314. X                command does not restore the original AB and PQ wirings.
  315. X
  316. XC-G             Undo.  Backup the permutation to the state it  had  before  the
  317. X                last   contiguous  sequence  of  keystrokes.    Arrow  commands
  318. X                terminate a contiguous sequence of keystrokes.  In most  cases,
  319. X                undo should be used instead of DEL or C-D.
  320. X
  321. XC-T             Try-all.   Display a list of the ascii characters that could be
  322. X                put in the current cursor position without conflicting with the
  323. X                existing permutation wirings.  The list is sorted with the most
  324. X                likely character first (leftmost).
  325. X
  326. XC-L             Redraws the whole screen.  As a side  effect  this  erases  the
  327. X                list of characters produced by C-T.
  328. X
  329. XF1, C-R         Move to the previous block of 256 characters.
  330. X
  331. XF2, C-S         Advance to next block of 256 characters.
  332. X
  333. X
  334. X
  335. X6.4. Guess Block Label window
  336. X     Title  for  the  Guess  Block  Storage  window.    Default arrow behavior.
  337. XParameters for guessing commands are displayed in this window.
  338. X
  339. X
  340. X
  341. X6.5. Guess Block Storage window
  342. X     This window is multiplexed between different strategies for guessing  that
  343. Xa  particular  plaintext  string is at some position in the block.  The general
  344. Xmeaning of the keystroke commands are:
  345. X
  346. XF2, C-S         Goto next guess.
  347. X
  348. XF3, C-A         Accept guess, merge it into the current decryption block.  This
  349. X                does not automatically advance to the next guess.
  350. X
  351. XC-G             Undo  the  merge of a guess.  Actually this is identical to the
  352. X                undo in the decryption block storage window, so  it  will  only
  353. X                undo  the  guess  if  you  have  not  typed any commands to the
  354. X                decryption window.
  355. X
  356. X
  357. X
  358. X6.6. Word Lookup
  359. X     This window displays the list of  words  in  a  dictionary  that  match  a
  360. Xparticular  pattern.    The  pattern is specified by the lookup-pattern command
  361. X(see section 7.4).  Only the first  20  or  so  matches  are  displayed.    The
  362. Xdictionary  file defaults to /usr/dict/words, but the pathname can be set using
  363. Xthe environment variable DICTIONARY.  The dictionary  file  contains  a  sorted
  364. Xlist of words separated by newline characters.  Case is ignored.
  365. X
  366. X
  367. X
  368. X6.7. User I/O window
  369. X     This  window consists of three lines: help, status, and command.  The help
  370. Xline changes as the cursor moves between windows.  It reminds the user  of  the
  371. Xcommands  available  in the current window.  A more elaborate help facility has
  372. Xnot been implemented.  The status line is used to  show  error  and  completion
  373. Xmessages.    The  cursor  cannot  be  positioned over either the help or status
  374. Xlines.
  375. X
  376. X     The command line behaves like a line editor.  The editing characters are:
  377. X
  378. XC-U             Erase the whole line.
  379. X
  380. XC-F, C-B        Move forward and backward one character.
  381. X
  382. XC-D, DEL        Delete one character forward or backward.
  383. X
  384. XF2, C-S         Next-Argument.  It searches for the first "%" character in  the
  385. X                command  line, deletes it and leaves the cursor there.  This is
  386. X                used with command templates.
  387. X
  388. XSpace           Within the first word on the command line,  a  space  character
  389. X                invokes  command  completion.   A completed command string is a
  390. X                template  command  with  argument  slots  (marked  by  %)   and
  391. X                suggested argument values.
  392. X
  393. XReturn          Execute command.  The cursor can be anywhere within the command
  394. X                line.
  395. X
  396. X7. User Commands
  397. X
  398. X
  399. X
  400. X7.1. quit
  401. X     Exit the program.  If any of the permutations have changed since they were
  402. Xlast saved, the user is asked for confirmation.
  403. X
  404. X
  405. X
  406. X7.2. save-permutation
  407. X     Associated  with  each block of the ciphertext is a permutation that tells
  408. Xhow to decode the known characters.  This  command  saves  those  permutations.
  409. XThere  is  a  special permutation, called Zee, that relates the permutations of
  410. Xsuccessive blocks.  The save command also saves Zee.
  411. X
  412. X
  413. X
  414. X7.3. load-permutations
  415. X     Inverse of save.  The ciphertext file is  loaded  automatically  when  CBW
  416. Xstarts,  but  the  permutation file must be loaded explicitly.  This command is
  417. Xused to load previously saved work.  Warning: the load command will replace the
  418. Xcurrent permutations without asking whether you want to save them first.
  419. X
  420. X
  421. X
  422. X7.4. lookup-pattern
  423. X     Searches  a  dictionary  for  words matching a pattern.  The dictionary is
  424. Xspecified by the shell variable DICTIONARY.  The pattern  is  specified  as  an
  425. Xargument  to  the  command.   Currently, the pattern consists of characters and
  426. Xperiods (.).  The period characters match any one character in a word from  the
  427. Xdictionary.    This  means that you have to know the length of the word you are
  428. Xlooking for.  The current dictionary does not contain  suffixes,  so  you  will
  429. Xoften need to try a few patterns to find the desired word.  There are many ways
  430. Xto improve this command.
  431. X
  432. X
  433. X
  434. X7.5. bigram guessing
  435. X     This command  uses  a  statistics  based  on  letter  pairs  (bigrams)  to
  436. Xcarefully  guess  at the plaintext.  This is the most useful command in CBW and
  437. Xit represents a significant improvement on  the  techniques  discussed  in  the
  438. XReeds  and  Weinberger paper.  This tool works by finding the best position for
  439. Xguessing, and then trying all 128 ascii characters in that position.  For  each
  440. Xof the 128 trials the deduced characters are scored and the trial with the best
  441. Xscore is accepted if it meets the criteria  set  by  the  user.    The  process
  442. Xrepeats for the next best position until no positions satisfy the user's cutoff
  443. Xcriteria.
  444. X
  445. X     The best position for guessing is the one that produces the most evidence.
  446. XIt  is  the  position  that generates the largest number of deduced characters.
  447. XPreference is given to positions that are deduced next to an  already  accepted
  448. Xcharacter  because  bigram  statistics  can  be  used  in  these  places.    An
  449. Xapproximation  to  the  best  position  can  be  identified  by  examining  the
  450. Xciphertext.  For the crypt cipher it is possible to identify all the characters
  451. Xin the ciphertext that were the output of a particular terminal  of  the  block
  452. Xrotor.    Each  of  the  128  trial plaintext characters for that position will
  453. Xgenerate a wiring from that terminal to some other  terminal.    If  the  other
  454. Xterminal  is  already used, the guess is rejected immediately.  However, if the
  455. Xrotor terminal is free, additional character positions may be  deduced  because
  456. Xof the symmetric nature of the rotor (recall that if the rotor maps X to Y then
  457. Xit also maps Y to X).  Thus by examining the ciphertext CBW  can  set  a  lower
  458. Xlimit  on  the  number  of  characters  that  will  be deduced by guessing in a
  459. Xparticular position.
  460. X
  461. X     The bigram command takes two arguments, a  cut-off  level  and  a  minimum
  462. Xprobability.  The purpose of the cutoff level is to insure that a guess is only
  463. Xaccepted if the probability of the guess being right is at  least  some  factor
  464. Xgreater  than  the  probability that the guess is wrong.  A cutoff level of 2.0
  465. Xtells CBW to only accept guesses when the probability of the guess being  right
  466. Xis  at  least twice as great as the probability that the guess is wrong.  Since
  467. Xall 128 possible guesses are tried, the probability of a guess being  wrong  is
  468. Xjust the sum of the probabilities that any other guess is correct.
  469. X
  470. X     The  probability  that  a guess is correct is based on a statistic that is
  471. Xthe sum of the logarithm of the expected letter  pair  frequencies  of  deduced
  472. Xcharacters  appearing next to the deduced or accepted characters.  The mean and
  473. Xvariance of this statistic is a simple function of  the  number  of  characters
  474. Xdeduced,  so it is possible to approximate the probability density distribution
  475. Xof the statistic with a  gaussian  distribution.    The  probability  (actually
  476. Xprobability  density) that a guess is correct can be computed from the gaussian
  477. Xdistribution based on the number of standard deviations that the observed value
  478. Xof the statistics differs from its expected value.
  479. X
  480. X     The  minimum  probability  tells  CBW to only accept the best guess if its
  481. Xprobability is higher than some value.  The minimum probability comes into play
  482. Xwhen  very  few  letter pairs are deduced.  In those cases it is better to skip
  483. Xguessing until additional characters have been deduced.
  484. X
  485. X     This command can be used to automatically deduce  about  100  of  the  256
  486. Xpossible positions within a block.  It is by far the most useful command in the
  487. Xworkbench.  My usual strategy is to run the command three times on each  block,
  488. Xfirst  with  a  cut-off  of  1.5  and a minimum probability of 0.6, then with a
  489. Xcut-off of 1.2 and a probability of 0.4, and finally with a cut-off of 1.0  and
  490. Xa probability of 0.15.
  491. X
  492. X     An  essential  aspect  of  this  command  is that it carefully selects the
  493. Xpositions where it does guessing.  After each guess  it  selects  the  position
  494. Xthat  will  deduce the maximum number of letters and letter pairs.  Without the
  495. Xcareful searching, it is only slightly  more  effective  than  the  equivalence
  496. Xclass command (which is now obsolete).
  497. X
  498. X     The  method  for computing the bigram probability is somewhat interesting.
  499. XRather than having a 128 x 128 entry table, the program uses a 36  x  36  entry
  500. Xtable  with  a  character mapping table.  For example, the character map treats
  501. Xupper and lower case letters the same, and it  treats  all  left  brackets  and
  502. Xparenthesis the same.  To compensate for the information lost by treating upper
  503. Xand lower case letters as the same, the program bases its  guess  probabilities
  504. Xon  the  product  (actually products are taken by summing logs) of the monogram
  505. Xand bigram probabilities for the deduced characters.  Compensating for the lost
  506. Xinformation  lead  to  a  30%  increase  in  the  number  of  correctly guessed
  507. Xcharacters.
  508. X
  509. X
  510. X
  511. X7.6. pwords
  512. X     Given a list of words that are likely  to  be  found  in  the  text,  this
  513. Xcommand  tries  each  word  in  every possible starting position, and accepts a
  514. Xguess if the score for the deduced characters  is  within  a  given  number  of
  515. Xstandard deviations of its expected value.  The list of words must be stored in
  516. Xa file, one word per  line,  using  standard  C  backslashing  conventions  for
  517. Xcontrol characters (e.g., "\n" for newline).
  518. X
  519. X     CBW  used  to  have a command that accepted words from the keyboard, but I
  520. Xfound that users  are  more  thorough  in  selecting  words  if  they  have  to
  521. Xseparately  edit  a  file.    The result is a collection of reusable files that
  522. Xbecomes a permanent part of your workbench.  For example, I have files for mail
  523. Xheaders, C programs, computer science articles, common short words, and various
  524. Xtext formatters.  Of course in the spirit of a workbench, if you  do  not  like
  525. Xthis limitation it is easy to add the desired command.
  526. X
  527. X
  528. X
  529. X7.7. auto-trigram guessing
  530. X     This command is obsolete.  Use pword instead.
  531. X
  532. X
  533. X
  534. X7.8. knit-blocks
  535. X     This  command is used to deduce the relationship between successive blocks
  536. Xof the cipher.  That relationship is stored in a permutation called Zee.  Given
  537. Xfour or more partially filled in blocks, the knit command can be used to deduce
  538. Xinformation about Zee.  You can then use the propagate command to transfer what
  539. Xyou  have  solved  in one block to any other block (see section 7.10).  For the
  540. Xtheory of knitting see the Reeds and Weinberger paper.
  541. X
  542. X     The knitting processes is not deterministic  unless  you  have  completely
  543. Xsolved  four  blocks  or partially solved more than five blocks.  When knitting
  544. Xblocks k through n, the knit command  displays  block  n+1  in  the  decryption
  545. Xwindow and in the guess window it displays the characters that would be deduced
  546. Xby each knitting guess.  You can use the F3 (or C-A)  key  to  accept  a  guess
  547. Xand/or the F2 to advance to the next guess.
  548. X
  549. X     The  knit command is intolerant of incorrect decodings of a block.  If you
  550. Xare not sure of the plaintext value of a character (e.g., whether some position
  551. Xcontains  a space or a tab character), it is best to leave character undecoded.
  552. XIf any character is incorrectly decoded, then the knit  command  will  run  for
  553. Xhours.    If the command runs for more than five minutes, abort it with C-Z.  A
  554. Xclever algorithm might avoid this mis-feature.
  555. X
  556. X     The knit command displays how much of Zee is currently known.
  557. X
  558. X
  559. X
  560. X7.9. Clear-zee
  561. X     Sets the Zee permutation to a state where no information is known.    This
  562. Xis the only way to recover from a bad knitting.
  563. X
  564. X
  565. X
  566. X7.10. propagate using Zee
  567. X     If  the  Zee  permutation is partially known, the propagate command can be
  568. Xused to deduce unknown characters in one block from known characters in another
  569. Xblock.   Its arguments are any two block numbers.  The blocks do not have to be
  570. Xadjacent.  The destination block will be displayed  in  the  decryption  window
  571. Xwith the deduced characters highlighted.
  572. X
  573. X8. Known Bugs
  574. X
  575. X   1. Due  to  a simple memory allocation strategy, only the first fifteen
  576. X      or so blocks of a file can be examined.
  577. X
  578. X   2. CBW can only process full 256 character blocks, which means that  it
  579. X      cannot be used to decode very short files.
  580. X
  581. X   3. Trigram stats are no longer used, so they should not be loaded.
  582. X
  583. X   4. Replacing  the  knit  window without accepting the current guess (by
  584. X      say invoking the propagate command),  causes  the  current  knitting
  585. X      guess to be accepted.  This bug comes from an oversight in my window
  586. X      package and is a bit of a pain to fix.
  587. X
  588. X   5. See the file TODO.txt for a list of suggested enhancements.
  589. X
  590. XAcknowledgments
  591. X     The author would like to thank Simson L.  Garfinkel,  Samuel  M.  Levitin,
  592. XClifford Neuman, and Tim Shepard for the ideas and programs they contributed to
  593. Xthis project.  Paul Paloski provided  extensive  comments  on  the  alpha  test
  594. Xversion of CBW, and John Gilmore enhanced it for portability.
  595. X
  596. XI. Graphics Map
  597. X
  598. X     CBW  uses  non-ascii  symbols  to  display non-printing characters such as
  599. Xnewline and tab.  Each kind of terminal supports a different  set  of  graphics
  600. Xcharacters  (if any), and even if two terminals support the same graphic (e.g.,
  601. Xmiddle horizontal bar) they usually represent  it  by  different  sequences  of
  602. Xascii  characters.  CBW handles these differences by using an explicit graphics
  603. Xsymbol map.  The map converts an internal symbol identifier into  a  string  of
  604. Xascii characters which cause the terminal to display the desired symbol.
  605. X
  606. X     The  graphics map can be set by the user via a shell environment variable.
  607. XThe map is build in three steps.  CBW first looks in the termcap entry for this
  608. Xterminal  for  the  definitions  that  describes  how  to  enter  and  exit the
  609. Xterminal's standout mode (inverse video) and graphics mode.  There  must  be  a
  610. Xdefinition  for  standout  mode,  but  the graphics mode fields can be missing.
  611. XNext,  a  default  graphics  map  is  read  from  a  compiled  in  string  (see
  612. Xterminal.h).    The  default  map uses standout mode to represent symbols.  For
  613. Xexample, the newline and tab characters are drawn by displaying an  'n'  and  a
  614. X't' in standout mode.  A complete list of the defaults is given in table I-1.
  615. X
  616. X-------------------------------------------------------------------------------
  617. X
  618. XGRAPHIC         USE
  619. X\St             Tab characters.
  620. X\SX             Non-Ascii character.
  621. X\Sn             Newline character.
  622. X\Sr             Return character.
  623. X\Sf             Form feed character.
  624. X\SC             Other control characters.
  625. X\S              Plaintext character unknown (standout space).
  626. X\N^             Pseudo underline to highlight char above this one.
  627. X\N|             Vertical line segment.
  628. X\N-             Horizontal line segment.
  629. X\N`             Lower-left corner of box.
  630. X
  631. X
  632. X                     Table I-1:   Default graphic symbols
  633. X
  634. X-------------------------------------------------------------------------------
  635. X
  636. X     The  last  step of building the graphics map is to read the shell variable
  637. XGRAPHICSMAP (if it is defined).  This variable is formatted like a /etc/termcap
  638. Xentry.   It is a sequence of definitions separated by whitespace (spaces, tabs,
  639. Xor newlines) or colons.  Each definition has a label and a value.  The label is
  640. Xa string terminated by an '=' character.  The label associated with each symbol
  641. Xis given in table I-2.  The value is a sequence of characters terminated  by  a
  642. Xcolon  (or  the  end  of  the  environment  variable  string).    The first two
  643. Xcharacters of the value string are special.  The  first  character  must  be  a
  644. Xbackslash  ('\').    The  second character specifies the mode that the terminal
  645. Xshould be in when the remainder  of  the  value  string  is  displayed.    That
  646. Xcharacter  must  be  one  of  'N', 'S', or 'G' for normal, standout, or graphic
  647. Xmode.  The combined mode of standout plus graphics cannot be represented  (this
  648. Xcould  be  fixed  in terminal.c).  The rest of the value characters can use the
  649. Xstandard backslash conventions (\n, \r, \t, \f, \\, and \177) with the addition
  650. Xthat \E will be translated into an escape character (\033).
  651. X
  652. X-------------------------------------------------------------------------------
  653. X
  654. XLABEL   SYMBOL
  655. Xtb      Tab characters.
  656. Xna      Non-Ascii character.
  657. Xlf      Newline character.
  658. Xcr      Return character.
  659. Xff      Form feed character.
  660. Xcc      Other control characters.
  661. Xuk      Plaintext character unknown.
  662. Xul      Pseudo underline to highlight char above this one.
  663. Xvb      Vertical line segment (bar).
  664. Xhb      Horizontal line segment (bar).
  665. Xll      Lower-left corner of box.
  666. X
  667. X
  668. X                  Table I-2:   Symbol labels for graphic map
  669. X
  670. X-------------------------------------------------------------------------------
  671. X
  672. X     The default map string and the h19 graphics map string are listed below to
  673. Xillustrate the format.
  674. XDefault Graphics Map String:
  675. X
  676. X        #define DGRAPHICS       "tb=\\St:na=\\SX: lf=\\Sn:cr=\\Sr:\
  677. X                                 ff=\\Sf:cc=\\SC:uk=\\S :::ul=\\N^:
  678. X                                 hb=\\N-:vb=\\N|:ll=\\N`:"
  679. X
  680. XH19 Graphics Map String:
  681. X
  682. X        setenv GRAPHICSMAP 'tb=\Gh:lf=\Gk:cr=\Gg:na=\Gi:\
  683. X                            ff=\G~:cc=\Gw:uk=\G^:ul=\Gz:\
  684. X                            hb=\G'\`':vb=\Ga:ll=\Ge'
  685. X
  686. X     To make up a new graphics map, you should first  find  out  the  range  of
  687. Xsymbols  that  your  terminal  can display.  Just put your terminal in graphics
  688. Xmode (see the 'as' and 'ae' definitions in the termcap for your  terminal)  and
  689. Xsend  it  all  the ascii character The file /projects/Ecrypt/graphics does this
  690. Xfor terminal that use \EF and \EG to enter and exit graphics  mode  (vt100  and
  691. Xh19).
  692. X
  693. XII. Key Map
  694. X
  695. X     CBW  uses a keymap to convert arbitrary sequences of ascii characters into
  696. Xkeystroke  commands.    The  information  in  the  map  comes  from  the  shell
  697. Xenvironment  variable  KEYMAP,  the  termcap entry for the user's terminal, and
  698. Xfrom a compiled in string that specifies the default map (see terminal.h).  The
  699. Xshell variable overrides the information from the other sources.
  700. X
  701. X     The  termcap  entry  for  the  terminal should provide all the information
  702. Xneeded by CBW.  It should not be necessary to use the  KEYMAP  variable.    The
  703. Xtermcap  entry can come from the environment variable TERMCAP, or from the file
  704. X/etc/termcap based on the value of the variable TERM.
  705. X
  706. X     The format of the key map environment variable string is the same  as  the
  707. Xformat  of the graphics map variable except that the first two character of the
  708. Xvalue field are not treated specially.  Each definition in the string  binds  a
  709. Xkeystroke  command  to  some  sequence of ascii characters.  Note that the same
  710. Xcommand can be bound to two or more  sequences.    The  label  portion  of  the
  711. Xdefinition  identifies  the  command  and the value portion gives the character
  712. Xsequence.  Table II-1 lists the label to use for each keystroke command.   Many
  713. Xof  the default bindings come the termcap entry.  In those cases, the label for
  714. Xthe definition in the termcap entry is given.    The  command  labels  used  in
  715. XKEYMAP are different from the terminal capability labels used in TERMCAP.
  716. X
  717. X-------------------------------------------------------------------------------
  718. X
  719. XLABEL   COMMAND
  720. Xup      Move cursor up.
  721. Xdo      Move cursor down.
  722. Xle      Move cursor left.
  723. Xri      Move cursor right.
  724. Xre      Redraw screen.
  725. Xun      Undo last guess accepted.
  726. Xcl      Clear command line.
  727. Xws      Word search (not fully implemented).
  728. Xdf      Delete current character and move forward.
  729. Xdb      Move left and delete that character.
  730. Xpr      Previous block or guess.
  731. Xne      Next block or guess.
  732. Xac      Accept guess.
  733. Xex      Execute command line or insert newline.
  734. Xta      Try all characters in this position.
  735. Xjc      Jump to command line.
  736. X
  737. X
  738. X                   Table II-1:   Command labels for key map
  739. X
  740. X-------------------------------------------------------------------------------
  741. X
  742. X     Several  termcap  definitions  are  required by CBW and several others are
  743. Xused if they are present.  CBW will print a message and  exit  if  one  of  the
  744. Xrequired  definitions  is missing.  Table II-2 list all the definitions used by
  745. XCBW.
  746. X
  747. X-------------------------------------------------------------------------------
  748. X
  749. XLABEL           USE
  750. Xis              Terminal initialization string.
  751. Xce              Erase to end of line.
  752. Xcd              Erase to end of screen.
  753. Xcl              Erase whole screen.
  754. Xcm              Cursor motion.
  755. Xas              Start graphics mode.
  756. Xae              End graphics mode.
  757. Xso              Start standout mode.
  758. Xse              End standout mode.
  759. Xks              Start send keypad escapes.
  760. Xke              End send keypad escapes.
  761. Xk1              The f1 key.
  762. Xk2              The f2 key.
  763. Xk3              The f3 key.
  764. Xk4              The f4 key.
  765. Xku              Up arrow.
  766. Xkd              Down arrow.
  767. Xkl              Left arrow.
  768. Xkr              Right arrow.
  769. X
  770. X
  771. X                 Table II-2:   TERMCAP definitions used by CBW
  772. X
  773. X-------------------------------------------------------------------------------
  774. X
  775. XIII. Command Summary
  776. X
  777. X
  778. XKEYSTROKE       COMMAND
  779. X
  780. XC-L             Redraw the whole screen.  As a side effect this erases the list
  781. X                of characters produced by C-T.
  782. X
  783. XC-X, F4         Jump to command input line.
  784. X
  785. XC-Q             Quote.  Insert the following character.
  786. X
  787. XC-Z             Abort  the current command, restore the terminal modes, suspend
  788. X                the program and return  to  the  shell.    If  the  program  is
  789. X                restarted,  the  terminal  will  be initialized for CBW and the
  790. X                screen redrawn.  The command that was active (if any) when  the
  791. X                C-Z  was received is aborted.  Actually this command is invoked
  792. X                when CBW receives a SIGTSTP signal.
  793. X
  794. XC-C             Restore the terminal modes and kill the CBW process.   Actually
  795. X                this command is invoked when CBW receives a SIGINT signal.
  796. X
  797. XC-D, DEL        Delete  character  forward,  delete  backward.    This forces a
  798. X                permutation wiring to be removed.  It can do unexpected things.
  799. X                Consider  a  permutation  with  A  wired  to  B  and P wired to
  800. X                Q. Adding a wire from B to P, then removing  it  with  the  DEL
  801. X                command does not restore the original AB and PQ wirings.
  802. X
  803. XC-G             Undo.    Backup  the permutation to the state it had before the
  804. X                last  contiguous  sequence  of  keystrokes.    Arrow   commands
  805. X                terminate  a  sequence.    In  most  cases, undo should be used
  806. X                instead of DEL or C-D.  The cursor must be in either the  guess
  807. X                block or the decryption block window.
  808. X
  809. XC-T             Try-all.   Display a list of the ascii characters that could be
  810. X                put in the current cursor position without conflicting with the
  811. X                existing permutation wirings.  The list is sorted with the most
  812. X                likely character first (leftmost).  The cursor must be  in  the
  813. X                decryption block window.
  814. X
  815. XF1, C-R         Move to the previous block of 256 characters.  Decryption block
  816. X                window only.
  817. X
  818. XF2, C-S         Advance to next block of  256  characters.    Decryption  block
  819. X                window only.
  820. X
  821. XF2, C-S         Goto next guess.  Guess block window only.
  822. X
  823. XF3, C-A         Accept guess, merge it into the current decryption block.  This
  824. X                does not automatically advance to the next guess.  Guess  block
  825. X                window only.
  826. X
  827. XC-F, C-B        Move forward and backward one character.
  828. X
  829. XC-D, DEL        Delete one character forward or backward.
  830. X
  831. XF2, C-S         Next-Argument.   It searches for the first "%" character in the
  832. X                command line, deletes it and leaves the cursor there.  This  is
  833. X                used with command templates.
  834. X
  835. XSpace           Within  the  first  word on the command line, a space character
  836. X                invokes command completion.  A completed command  string  is  a
  837. X                template   command  with  argument  slots  (marked  by  %)  and
  838. X                suggested argument values.
  839. X
  840. XReturn          Execute command.  The cursor can be anywhere within the command
  841. X                line.
  842. X
  843. X
  844. X
  845. X-------------------------------------------------------------------------------
  846. X
  847. X                                 USER COMMANDS
  848. X
  849. X
  850. Xquit-program permanently
  851. X
  852. Xauto-trigram max_dev: % min_total_chars: % min_wire_chars: %
  853. X
  854. Xknitting using blocks from: % to: % Min show count: %
  855. X
  856. Xlookup-pattern: % in dictionary
  857. X
  858. Xequivalence-class guess, use accept level: % (try 2.0)
  859. X
  860. Xpwords-from file: % Max dev: % (try 1.0)
  861. X
  862. Xload-permutations
  863. X
  864. Xsave-permutations
  865. X
  866. Xclear-zee permutation
  867. X
  868. Xpropagate-info from: % to: % using Zee
  869. X
  870. Xbigram-guess level: % (2.0), min_prob: % (0.15)
  871. X
  872. XIV. Tutorial
  873. X
  874. X     The  following  is  a  step  by  step  sequence of commands to compile and
  875. Xexercise the Crypt Breakers Workbench.  It demonstrates how easily crypt  files
  876. Xcan be broken.
  877. X
  878. X   1. Edit  stats.slice to set the name of the directory that contains the
  879. X      statistics files.  Statistics for scribe documents are included with
  880. X      the source files.
  881. X
  882. X      The  stats.slice  file  also  defines the location of the dictionary
  883. X      used by the lookup-pattern  command.    The  default  dictionary  is
  884. X      /usr/dict/words.    The  dictionary is just a list of words, one per
  885. X      line.  Case does not matter.
  886. X
  887. X   2. Execute 'source  stats.slice'  to  initialize  the  necessary  shell
  888. X      variables.
  889. X
  890. X   3. If there is a .slice file for your terminal type (e.g., vt100.slice,
  891. X      or h19.slice), execute source on that file.   This  initializes  the
  892. X      graphics map and key map.
  893. X
  894. X   4. Print  out  cbw.doc,  so you can read it after you have decided that
  895. X      you can't figure out how the program works.
  896. X
  897. X   5. Copy test3.perm and .cipher to foo.perm and foo.cipher.    The  .txt
  898. X      files contain the original plaintext.
  899. X
  900. X   6. Execute 'cbw foo'.
  901. X
  902. X   7. The  cursor  will  on the command line.  Use the arrow keys (or C-P,
  903. X      C-N, C-F, C-B) to move the cursor to the upper lefthand position  of
  904. X      the  decryption  window.   Try typing '@Device[Dover]'.  Notice that
  905. X      most of the characters you type  deduced  other  characters  in  the
  906. X      block.
  907. X
  908. X   8. The  'D'  in  'Dover'  is wrong.  Using the arrow keys, position the
  909. X      cursor over the 'D' and type 'd'.
  910. X
  911. X   9. Advance to the position after the ']' and  type  C-T.    A  list  of
  912. X      possible  characters  for this position will be displayed.  The list
  913. X      is sorted with the most likely character on the left.   Notice  that
  914. X      many characters are not possible because they would deduce non-ascii
  915. X      characters elsewhere in the  block,  or  they  would  conflict  with
  916. X      previously accepted guesses.
  917. X
  918. X      Try  guessing  tab,  comma  and linefeed for the character after the
  919. X      ']'.  Use C-G to undo each guess.  Delete and C-D do not restore the
  920. X      old  state,  they  just  erase  the  wiring  that  was  deduced by a
  921. X      particular character.
  922. X
  923. X  10. Move the cursor down to the command line.  You can use emacs  cursor
  924. X      characters  (C-N,  C-P, C-F, C-B) or the arrow keys.  Unfortunately,
  925. X      C-U does not work as in emacs.  The C-X key or F4 will jump directly
  926. X      to the command line.
  927. X
  928. X  11. Type  'pw  '.    The  space  will  cause  command completion for the
  929. X      probable-word guessing command.  Type F2 (or C-S) to advance to  the
  930. X      first  argument,  and  enter  the  file name 'mss.words'.  That file
  931. X      contains a list of keywords used  by  the  Scribe  (Finalword)  text
  932. X      formatter.    Press  F2  to  advance  to  the second argument, which
  933. X      specifies a cut-off level for automatically accepting guesses.   The
  934. X      level  is the maximum number of standard deviations that the scoring
  935. X      function can be away from its expected value.  Enter 1.2, and  press
  936. X      return to invoke the command.
  937. X
  938. X  12. A  partially filled in block will appear in the guessing window.  To
  939. X      accept the result of this command, press F3 (or C-A).
  940. X
  941. X  13. Try the pword guess command again with a level of 3.   To  do  this,
  942. X      just  move  to  the  command  line, change the 1.2 to a 3, and press
  943. X      return.  Again F3 accepts the guess.  If  some  guesses  look  wrong
  944. X      (such  as the 'F' on the second line under the '[Article]'), you can
  945. X      correct them using the editor in the decryption block window.
  946. X
  947. X  14. Advance to block  1  of  the  file  by  moving  the  cursor  to  the
  948. X      decryption  window and pressing F2 (or C-S).  F1 (or C-R) moves back
  949. X      one block, F2 moves ahead one block.
  950. X
  951. X  15. The second block is likely to  be  plain  english  with  few  scribe
  952. X      commands.    Move  to the command window, type C-U to erase the line
  953. X      and type 'bi ' to  setup  the  bigram  guessing  command.    Try  an
  954. X      acceptance  level  of  1.0  and  a minimum probability of 0.6.  Type
  955. X      return to invoke the command.
  956. X
  957. X  16. After a short wait (~15  seconds),  a  partial  block  will  appear.
  958. X      Accept the guess with the F3 key in the guessing window.
  959. X
  960. X  17. Try  looking  up a pattern in the dictionary.  In the command window
  961. X      type 'look ', use F2 to advance to the  pattern,  and  type  in  the
  962. X      pattern  '....llit.', and press return.  This will match against the
  963. X      word 'satellite' if it is in you site's dictionary.
  964. X
  965. X  18. One could go on like this, but let's skip  ahead  by  loading  in  a
  966. X      previously  saved state.  Invoke the load command (it loads the file
  967. X      foo.perm, just as save dumps to foo.perm (making this command take a
  968. X      filename  is  a  good implementation exercise)).  Type C-U, 'load ',
  969. X      and return.  Notice that all the work so  far  is  replaced  by  the
  970. X      information in the .perm file.  This can be considered a feature.
  971. X
  972. X  19. Use  the  F1 and F2 keys in the decryption window to view the blocks
  973. X      that have been solved.  Notice that a fully solved  block  does  not
  974. X      specify  all  the wirings of the block key (permutation).  Typically
  975. X      only 105 of the 128 wires are used.
  976. X
  977. X  20. Lets try deducing the inter-block relationship (zee).   Execute  the
  978. X      clear-zee command.
  979. X
  980. X  21. Execute  knit  blocks 0 through 3 with a min show count of 20.  This
  981. X      means that the program should only show you guesses that  deduce  20
  982. X      or more wirings of the zee permutation.  Press return to invoke this
  983. X      guessing strategy.  The cursor will move  to  the  guessing  window.
  984. X      Press F2 to start the first round of guessing.
  985. X
  986. X      The running time of the knit command is exponential in the number of
  987. X      blocks knitted, and it will run for a very long time if any  of  the
  988. X      blocks  are  decrypted incorrectly.  This means that it is better to
  989. X      leave a position blank than to guess at it.
  990. X
  991. X  22. The program moves to block 4 and shows you the characters in block 4
  992. X      that would be deduced from block 3 given the deduced wirings of zee.
  993. X      If these look reasonable, press F3 to accept the guess, and press F2
  994. X      to try the next guess.  To reject a guess, press F2 without pressing
  995. X      F3.
  996. X
  997. X  23. Now that part of zee is known, try propagating the settings of block
  998. X      1 into block 0 using zee.  The propagate command will do this.  Also
  999. X      try propagating blocks 2, 3, and 4 to zero.
  1000. X
  1001. X      Notice that the number of known wires can increase without  deducing
  1002. X      additional characters in the block.
  1003. X
  1004. X  24. There should be a command that propagates information between groups
  1005. X      of blocks, but for now you must do this one block at a time.   After
  1006. X      propagating  block 1 - 4 to block zero, and block zero to blocks 1 -
  1007. X      4, et cetera, try the knit command again.
  1008. X
  1009. X  25. Propagate block 4 to 5  to  provide  a  framework  to  evaluate  new
  1010. X      guesses.
  1011. X
  1012. X  26. Knit block 0 through 4 with a minimum show level of 2.  You may want
  1013. X      to skip accepting guesses that do not deduce any characters.  Repeat
  1014. X      this process with a show level of 1.
  1015. X
  1016. X  27. The  program  should  now  know  all 256 wirings of zee.  Repeat the
  1017. X      process of propagating information  between  blocks  until  all  128
  1018. X      wires of the block zero are known.
  1019. X
  1020. X  28. Save  your  work  with the save-permutations command (on the command
  1021. X      line type 'sa ' and press return).  This writes the file foo.perm.
  1022. X
  1023. X  29. Exit the program with the quit command.
  1024. X
  1025. X  30. Copy foo.perm to zeecode.perm.
  1026. X
  1027. X  31. Execute 'zeecode < foo.cipher | more '.  This  program  reads  CBW's
  1028. X      save  file  to  find  the  permutation  for  block  zero and the Zee
  1029. X      permutation  that  describes  how  the  remaining  block  keys   are
  1030. X      generated.    Using  this  information it decodes standard input and
  1031. X      writes on standard output.
  1032. X
  1033. X  32. That's all.
  1034. X
  1035. X                               Table of Contents
  1036. XOverview                                                                      2
  1037. X1. Introduction to the Workbench                                              2
  1038. X2. Key Space Attack                                                           2
  1039. X3. Files, Terminals and Shell Variables                                       2
  1040. X     3.1. Terminal compatibility                                              2
  1041. X4. Getting Started and Getting Out                                            2
  1042. X5. Commands                                                                   2
  1043. X6. Windows                                                                    4
  1044. X     6.1. Banner window                                                       4
  1045. X     6.2. Decryption Block Label window                                       4
  1046. X     6.3. Decryption Block Storage window                                     4
  1047. X     6.4. Guess Block Label window                                            4
  1048. X     6.5. Guess Block Storage window                                          4
  1049. X     6.6. Word Lookup                                                         4
  1050. X     6.7. User I/O window                                                     4
  1051. X7. User Commands                                                              4
  1052. X     7.1. quit                                                                4
  1053. X     7.2. save-permutation                                                    4
  1054. X     7.3. load-permutations                                                   4
  1055. X     7.4. lookup-pattern                                                      4
  1056. X     7.5. bigram guessing                                                     4
  1057. X     7.6. pwords                                                              5
  1058. X     7.7. auto-trigram guessing                                               5
  1059. X     7.8. knit-blocks                                                         5
  1060. X     7.9. Clear-zee                                                           5
  1061. X     7.10. propagate using Zee                                                5
  1062. X8. Known Bugs                                                                 5
  1063. XAcknowledgments                                                               6
  1064. XI. Graphics Map                                                               7
  1065. XII. Key Map                                                                   8
  1066. XIII. Command Summary                                                          9
  1067. XIV. Tutorial                                                                 10
  1068. X
  1069. X                                List of Figures
  1070. XFigure 5-1:   Sample Screen                                                   3
  1071. X
  1072. X                                List of Tables
  1073. XTable I-1:   Default graphic symbols                                          7
  1074. XTable I-2:   Symbol labels for graphic map                                    7
  1075. XTable II-1:   Command labels for key map                                      8
  1076. XTable II-2:   TERMCAP definitions used by CBW                                 8
  1077. END_OF_cbw.doc
  1078. if test 51998 -ne `wc -c <cbw.doc`; then
  1079.     echo shar: \"cbw.doc\" unpacked with wrong size!
  1080. fi
  1081. # end of overwriting check
  1082. fi
  1083. echo shar: End of archive 11 \(of 11\).
  1084. cp /dev/null ark11isdone
  1085. MISSING=""
  1086. for I in 1 2 3 4 5 6 7 8 9 10 11 ; do
  1087.     if test ! -f ark${I}isdone ; then
  1088.     MISSING="${MISSING} ${I}"
  1089.     fi
  1090. done
  1091. if test "${MISSING}" = "" ; then
  1092.     echo You have unpacked all 11 archives.
  1093.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1094. else
  1095.     echo You still need to unpack the following archives:
  1096.     echo "        " ${MISSING}
  1097. fi
  1098. ##  End of shell archive.
  1099. exit 0
  1100.